<?php

namespace app\order\controller;

use app\common\controller\PCBase;
use app\BaseController;//测试专用
use app\order\logic\OrderReportSkuLogic;
use think\facade\Db;
use Throwable;
use app\common\library\Upload;

class OrderReportSku extends PCBase
{


    public function initialize(): void
    {
        parent::initialize();
    }

    /**
     * index
     * @throws Throwable
     */
    public function index()
    {
        $params              = $this->request->post();
        $OrderReportSkuLogic = new OrderReportSkuLogic();
        //获取admin_id信息
        $adminId            = $this->getAdminId();
        $groupId            = $this->getAdminGroupId();
        $params['adminId']  = $adminId;
        $params['groupId']  = $groupId;
        return $OrderReportSkuLogic->index($params);
    }

    /**
     * index
     * @throws Throwable
     */
    public function skuinfo()
    {
        $params     = $this->request->post();
        $OrderReportSkuLogic = new OrderReportSkuLogic();
        $data = $OrderReportSkuLogic->skuinfo($params);
        return json(DefaultResponse(200, true, '获取成功', $data));
    }
    /**
     * sku销量排名
     * @throws Throwable
     */
    public function spuSalesRanking()
    {
        $params     = $this->request->post();
        $OrderReportSkuLogic = new OrderReportSkuLogic();
        return $OrderReportSkuLogic->spuSalesRanking($params);
    }

    /**
     * export
     * @throws Throwable
     */
    public function export()
    {
        $params     = $this->request->post();
        $OrderReportSkuLogic = new OrderReportSkuLogic();
        return $OrderReportSkuLogic->export($params);
    }

    /**
     * export
     * @throws Throwable
     */
    public function export_skuinfo()
    {
        $params     = $this->request->post();
        $OrderReportSkuLogic = new OrderReportSkuLogic();
        return $OrderReportSkuLogic->export_skuinfo($params);
    }
}
